<template>
  <div>
    <el-row justify="center">
      <h1>库存一览</h1>
    </el-row>
    <el-row>
      <el-col :span="22">

        <!--        动态查询的-->
        <div  style="display: flex ;justify-content: space-evenly;margin-bottom: 20px">
          <el-form-item label="开始日期" style="width: 250px">
            <el-date-picker
                v-model="paramObj.startDate"
                type="date"
                placeholder="请选择结束日期"
                value-format="YYYY-MM-DD"
                size="large"
            />
          </el-form-item>
          <el-form-item label="结束日期" style="width: 250px">
            <el-date-picker
                v-model="paramObj.endDate"
                type="date"
                placeholder="请选择结束日期"
                value-format="YYYY-MM-DD"
                size="large"
            />
          </el-form-item>
          <el-button @click="findByItem(1)" type="primary">查询</el-button>

        </div>
        <!--       表格 -->
        <el-table :data="cutObj.records" style="width: 100%;margin-bottom: 20px " border stripe>
          <el-table-column prop="createDate" label="日期"/>
          <el-table-column prop="content" label="内容"/>
        </el-table>
        <!--     分页   -->
        <el-pagination
            v-model:current-page="currentPage"
            v-model:page-size="pageSize"
            background
            layout="prev, pager, next, jumper"
            :total="this.cutObj.total"
            @current-change="findByItem"
        />


      </el-col>
    </el-row>
  </div>
</template>
<script>
import axios from "axios"
export default {
  data() {
    return {
      cutObj: {},
      currentPage: '',
      pageSize: 5,
      paramObj: {},
    }
  },methods:{
    findByItem(pageNO){
      this.currentPage = pageNO;
      this.paramObj.pageNO = pageNO;
      axios.get('/project/log/findByItem',{params:this.paramObj}).
      then(resp=>{
        this.cutObj=resp.data;
      })

    }

  },created() {
    this.findByItem(1);
  }
}
</script>

<style scoped>

</style>